using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using labDict.Web.provider;

namespace labDict.Web.business
{
    public class DataTables
    {
        public enum DataTableType
        {
            Container = 0,
            Division = 1,
            Test_Schedule = 2,
            WebTAT = 3,
            Method = 4,
            Shipping = 5,
            WebUnits = 6,
            WebSpecimen = 7,
            Specimen = 8,
            Disclaimer = 9,
            Functional_Area = 10,
            Ulticare_Req = 11,
            Downtime_Req = 12
        }

        public static bool UpdateDataTable(string updateSql)
        {
            return SQLHelper.UpdateResult(updateSql);   
        }


        public static string GetTableName(int id)
        {
            switch (id) { 
                case 0:
                    return DataTables.DataTableType.Container.ToString();
                    break;
                case 1:
                    return DataTables.DataTableType.Division.ToString();
                    break;
                case 2:
                    return DataTables.DataTableType.Test_Schedule.ToString();
                    break;
                case 3:
                    return DataTables.DataTableType.WebTAT.ToString();
                    break;
                case 4:
                    return DataTables.DataTableType.Method.ToString();
                    break;
                case 5:
                    return DataTables.DataTableType.Shipping.ToString();
                    break;
                case 6:
                    return DataTables.DataTableType.WebUnits.ToString();
                    break;
                case 7:
                    return DataTables.DataTableType.WebSpecimen.ToString();
                    break;
                case 8:
                    return DataTables.DataTableType.Specimen.ToString();
                    break;
                case 9:
                    return DataTables.DataTableType.Disclaimer.ToString();
                    break;
                case 10:
                    return DataTables.DataTableType.Functional_Area.ToString();
                    break;
                case 11:
                    return DataTables.DataTableType.Ulticare_Req.ToString();
                    break;
                case 12:
                    return DataTables.DataTableType.Downtime_Req.ToString();
                    break;
                default:
                    return DataTables.DataTableType.Container.ToString();
                    break;
            }
        
        }


        public static int GetNewIndex(string tableName, string indexName)
        {
            return SQLHelper.GetNewIndex(tableName, indexName);
        }

        public static bool InsertData(string insertSql)
        {
            return SQLHelper.InsertResult(insertSql);
        }
    }
}
